home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / john / hc_showd.hqx / ShowDialog XCMD 1.4 / card_7869.txt < prev    next >
Encoding:
Text File  |  1989-08-30  |  2.4 KB  |  79 lines

  1. -- card: 7869 from stack: in.4
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2607
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on closeCard
  8.   put empty into cd fld "theResult"
  9. end closeCard
  10.  
  11.  
  12. -- part 1 (button)
  13. -- low flags: 00
  14. -- high flags: A003
  15. -- rect: left=127 top=281 right=303 bottom=376
  16. -- title width / last selected line: 0
  17. -- icon id / first selected line: 0 / 0
  18. -- text alignment: 1
  19. -- font id: 0
  20. -- text size: 12
  21. -- style flags: 0
  22. -- line height: 16
  23. -- part name: "Change" Dialog with Popup
  24. ----- HyperTalk script -----
  25. on mouseUp
  26.   put "<BBold,<IItalic,<OOutline,<UUnderline,<SShadow,(-," & "Everything,Letters Only,Numbers Only,Uppercase,Lowercase" into theMenu
  27.   ShowDialog 4,4745,"Find What:","Change To:", "Your string goes here.",theMenu,7
  28.   if the result is empty then
  29.     put return & "You clicked the ΓÇ£CancelΓÇ¥ button." into cd fld "theResult"
  30.   else
  31.     put the result into temp
  32.     put "Menu item selected was:" && item 1 of temp & return into cd fld "theResult"
  33.     if item 2 of temp is empty then
  34.       put "String 1 was:  empty" & return after cd fld "theResult"
  35.     else put "String 1 was:" && item 2 of temp & return after cd fld "theResult"
  36.     if item 3 of temp is empty then
  37.       put "String 2 was:  empty" after cd fld "theResult"
  38.     else put "String 2 was:" && item 3 of temp after cd fld "theResult"
  39.   end if
  40. end mouseUp
  41.  
  42.  
  43.  
  44. -- part 2 (field)
  45. -- low flags: 01
  46. -- high flags: 0000
  47. -- rect: left=0 top=225 right=277 bottom=512
  48. -- title width / last selected line: 0
  49. -- icon id / first selected line: 0 / 0
  50. -- text alignment: 1
  51. -- font id: 3
  52. -- text size: 12
  53. -- style flags: 0
  54. -- line height: 16
  55. -- part name: theResult
  56.  
  57.  
  58. -- part contents for background part 2
  59. ----- text -----
  60. ShowDialog XCMD Type 4 Example
  61.  
  62. -- part contents for background part 3
  63. ----- text -----
  64. ShowDialog XCMD Type 4 (continued...)
  65.  
  66.  
  67. -- part contents for background part 7
  68. ----- text -----
  69. 21
  70.  
  71. -- part contents for background part 1
  72. ----- text -----
  73.  
  74.  
  75. Your dialog will be displayed with the popup menu item selected that you specified in the parameter list.  When you click on the hot spot the popup menu title will invert and the popup menu will appear over the hot spot.
  76.  
  77. The popup menu item number currently selected when the OK button is clicked will be returned as item 1 of "the result."  The text in the editable text fields will be returned as items 2 and 3 of "the result."
  78.  
  79. If the user clicks CANCEL "the result" will be empty.